<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib tagdir="/WEB-INF/tags" prefix="p" %>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/validators/task.js"></script>

<div class="f_l margin1" style="width:100%">
    <div style="height:24px;color:red" align="center" id="errorInfo">${failInfo }</div>
    <div style="height:24px;color:red;font-weight:bold" align="left">新建任务</div>
    <s:form id="submitForm" action="task!save" method="post" theme="simple">
    <table>
    	<tbody>
    		<tr>
    			<td width="10%"><s:text name="任务名称"/>：</td>
    			<td><input type="text" name="task.taskName"><span id="taskNameError"></span></td>
    		</tr>
    		<tr>
    			<td><s:text name="负 责 人"/>：</td>
    			<td>
	    			<select onchange="javascript:commonSelect(this,'ownerName');" name="task.ownerId">
	                <option value="">-- 请选择 --</option>
		            <s:iterator value="allChargePersons" status="status">
		                <option value="${id}">${userName}</option>
		            </s:iterator>
            		</select>
            		<span id="ownerError"></span>
            	</td>
    		</tr>
    		<tr>
    			<td><s:text name="开始时间"/>：</td>
    			<td><input readonly="true" id="startDate" name="task.startDate" value='<s:date name="task.startDate" format="yyyy-MM-dd"/>' onclick="return showCalendar('startDate', 'y-mm-dd');" /><span></span></td>
    		
	   		</tr>
	   		<tr>
	   		    <td><s:text name="结束时间"/>：</td>
    			<td><input readonly="true" id="endDate" name="task.endDate" value='<s:date name="task.endDate" format="yyyy-MM-dd"/>' onclick="return showCalendar('endDate', 'y-mm-dd');" /><span></span></td>
	   		</tr>
	   		<tr>
	   		    <td><s:text name="任务状态"/>：</td>
    			<td><select name="task.status"><option value="0"> 未开始 </option><option value="1"> 处理中 </option></select></td>
	   		</tr>
	   		<tr>
	   			<td><s:text name="任务内容"/>：</td>
    			<td><textarea name="task.content" rows="10" cols="35"></textarea><span id="contentError"></span></td>
	   		</tr>
			<tr>
    			<td align="right">
    				<input type="submit" value="确认" onclick="return doValidate(event)" />
    			</td>
    			<td align="left">
    				<input type="button" value="取消" onclick="window.location.href='task!list'"/>
    			</td>
    		</tr>
    	</tbody>
    </table>
    <input type="hidden" name="task.ownerName" id="ownerName" />
    </s:form>
</div>
